PATHMac OS 8 and 9 Developer Documentation > Human Interface Toolbox > Control Manager >

Programming With the Mac OS 8.5 Control Manager


SetControlViewSize

Informs the Control Manager of the size of the content to which a control's size is proportioned.

pascal void SetControlViewSize (
                     ControlHandle theControl,
                     SInt32 newViewSize);
theControl
A value of type ControlHandle . Pass a handle to the control whose view size is to be set.
newViewSize
A signed 32-bit integer. Pass a value specifying the size of the content being displayed. This value should be expressed in terms of the same units of measurement as are used for the minimum, maximum, and current settings of the control.

DISCUSSION

Your application should call the SetControlViewSize function to support proportional scroll boxes. If the user selects the systemwide Appearance preference for proportional scroll boxes and your application doesn't call SetControlViewSize , it will still have the traditional square scroll boxes.

To support a proportional scroll box, simply pass the size of the view area--in terms of whatever units the scroll bar uses--to SetControlViewSize . The system automatically handles resizing the scroll box, once your application supplies this information. Listing 1-1 in Creating a Proportional Scroll Box shows some typical code for setting a scroll bar according to a TextEdit handle, which includes making the scroll box proportional.


VERSION NOTES

Available with Mac OS 8.5 and later.


SEE ALSO

The function GetControlViewSize .


© 1999 Apple Computer, Inc. — (Last Updated 20 Jan 99)